<div class="bg-light lter b-b wrapper-md">
	<h1 class="m-n font-thin h3"><span class="font-bold" translate="aside.nav.process.paymentOperation">Payment Operation</span> </h1>
</div>
<div ng-class="isSmart?'':'wrapper-md'" class="remove-wrapper" >
	<div ng-controller="PaymentOperationDataTableController">
		<div class="panel panel-default">
			<div class="wrapper-md">
				<div class="col-sm-3" style="width:190px; margin-bottom:5px;">
					<div class="btn-group" style="margin-right:15px;" ng-init="paid = 'false'">
						<label class="btn btn-sm btn-info font-bold ng-pristine ng-untouched ng-valid active" ng-model="paid" btn-radio="'false'"><i class="fa fa-check text-active"></i> <span translate="business.servreq.paid0">Unpaid</span></label>
						<label class="btn btn-sm btn-primary font-bold ng-pristine ng-untouched ng-valid" ng-model="paid" btn-radio="'true'"><i class="fa fa-check text-active"></i> <span translate="business.servreq.paid1">Paid</span></label>
					</div>
				</div>
				<div class="col-sm-9">
					<div class="input-group">
						<input ng-model="$parent.like" class="form-control"
                               placeholder="{{ (selectLang == 'English') ? 'enter keywords' : '\u8bf7\u8f93\u5165\u5173\u952e\u5b57' }}" type="text" autocomplete="off">
						<span class="input-group-btn">
						<button class="btn btn-success font-bold" type="button" ng-click="startSearch($parent.like)"><span translate="business.navtitle.search_patient">Search</span></button>
						</span> </div>
				</div>
			</div>
			<table ui-jq="dataTable" ui-options="dtOptions" style="width:100%" class="table table-striped m-b-none">
				<thead>
					<tr class="row">
						<th ng-class="isSmart?'col-xs-3':''" class="" translate="business.servreq.id"></th>
						<th class="" translate="common.updated" ng-if="!isSmart"></th>
						<th class="col-xs-3" translate="common.name"></th>
						<th class="" translate="user.gender" ng-if="!isSmart"></th>
						<th class="" translate="business.patcase.disease_type" ng-if="!isSmart"></th>
						<th ng-class="isSmart?'col-xs-3':''" class="" translate="business.servreq.opeCent"></th>
						<th class="col-sm-1" translate="business.servreq.amount_Operation" ng-if="!isSmart"></th>
						<th class="" translate="business.servreq.paid" ng-if="!isSmart"></th>
						<th ng-class="isSmart?'col-xs-3':''" translate="common.operate"></th>
					</tr>
				</thead>
				<tbody>
					<tr class="row" ng-repeat="serv in servRequests">
						<td>S-{{ serv.servReq_Id}}</td>
						<td ng-if="!isSmart">{{ moment(serv._patCase._patient.updated).format('YYYY-MM-DD') }}</td>
						<td>{{ serv._patCase._patient._user.realName }}</td>
						<td ng-if="!isSmart"><span ng-show="serv._patCase._patient._user.gender != null" translate="{{ 'user.gender.' + serv._patCase._patient._user.gender}}"></span></td>
						<td ng-if="!isSmart"><span translate="{{'business.patcase.disease_type_' + serv._diseaseType.desc}}"></span></td>
						<td>{{ (selectLang == "English") ? serv._opeCenTime._hosp.hosp_En_Name : serv._opeCenTime._hosp.hosp_Cn_Name }}</td>
						<td ng-if="!isSmart">{{serv.amount_Operation}}</td>
						<td ng-if="!isSmart">
							<span translate="{{(serv.paid_Operation == 0 ? 'business.servreq.paid0' : 'business.servreq.paid1') }}"></span>
						</td>
						<td style="width: 20%;">
							<script type="text/ng-template" id="openServReq.html">
								<div ng-include="'views/work/basic_servreq_flow.html?abc=d'"></div>
							</script>
							<button type="button"
									ng-click="open({ templateUrl: 'openServReq.html'}, {{ serv }} );"
									class="btn btn-sm btn-info font-bold"
									title="{{ 'common.details' | translate }}">
								<span translate="common.details"></span>
							</button>
							<button type="button" ng-click="openConfirmPaymentPopup(serv)" class="btn btn-sm btn-success font-bold"
									title="{{'common.submit' | translate}}" ng-if="serv.canBePaidOperation == true">
								<span translate="common.submit"></span>
							</button>
						</td>
					</tr>
				</tbody>
			</table>
		</div>
	</div>
</div>
<script type="text/ng-template" id="confirmPayment.html">
	<div class="modal-header">
		<button type="button" class="close" ng-click="cancel()"><span class="icon icon-close" aria-hidden="true"></span></button>
		<h4>{{'aside.nav.process.paymentOperation' | translate}}</h4>
	</div>
	<div class="modal-body">
		<div class="panel panel-default">
			<div class="panel-body">
				<div class="form-group">
					<div class="form-group row" >
				<label class="col-sm-2 control-label ">{{ 'user.icNo' | translate }}</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control"
                            value="{{items._patCase._patient._user.icNo}}" style="cursor:default" disabled>
                </div>
                <label class="col-sm-2">{{ 'user.realname' | translate }}</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control"
                            ng-model="items._patCase._patient._user.realName" style="cursor:default" disabled>
                </div>
                <div class="clearfix"></div>
				</div>
					<div class="form-group row" >
				<label class="col-sm-2 control-label ">{{ 'user.gender' | translate }}</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control"
                          value="{{'user.gender.' + items._patCase._patient._user.gender | translate}}" style="cursor:default" disabled>
                </div>
                <label class="col-sm-2">{{'business.patcase.disease_type' | translate}}</label>
                <div class="col-sm-4">
                    <input type="text" class="form-control"
                            value="{{'business.patcase.disease_type_' + items._diseaseType.desc | translate}}" style="cursor:default" disabled>
                </div>
                <div class="clearfix"></div>
				</div>
				
				<div class="form-group row" >
                <label class="col-sm-2">{{'business.servreq.amount_Operation' | translate}}</label>
                <div class="col-sm-4">
                	<input type="number" class="form-control"
                            ng-model="items.amount_Operation" style="cursor:default">
                </div>
                <div class="clearfix"></div>
				</div>
				</div>
			</div>
		</div>
	</div>
	<div class="modal-footer">
		<button class="btn btn-default" ng-click="cancel()">{{ 'common.cancel' | translate }}</button>
		<button class="btn btn-primary" ng-click="ok()" >{{ 'common.ok' | translate }}</button>
	</div>
</script>